/*
 * Copyright (c) 2009 the original author or authors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.as3undohistory.register
{
	/**
	 * Describes an object that can examine an object's metadata and create a list of IAccessorRegistrations
	 * for each property that has been marked with the [Undoable] metadata. 
	 * @author Administrator
	 * 
	 */
	public interface IObjectRegistration
	{
		/**
		 * Deletes all registration data 
		 * 
		 */
		function clear():void;
		/**
		 *  
		 * @param clazz the class to check for
		 * @return true if the class has already been registered
		 * 
		 */
		function isClassRegistered(clazz:Class):Boolean;
		
		/**
		 * Registers a list of classes, this method calls the registerClass method for each element
		 * in the classes paramater. The second optional paramater can be an array of accessorName arrays,
		 * when this parameter is not null it is required that the array has the same length as the classes
		 * array parameter.
		 * @param classes the list of classes to be registered
		 * @param accessorNamesList optional list of accessornames for each class
		 * @return an array of IUndoClassRegistration implementations
		 * 
		 */		
		function registerClasses(classes:Array, accessorNamesList:Array=null):Array;
		/**
		 * Examines the specified Class object and looks for getter/setter pairs (properties) that have been marked with the [Undoable]
		 * metadata. Optionally an Array of accessorNames can be specified in case an object inherits from another object whose
		 * source code can't be modified with the necesary metadata.
		 * @param clazz the class to be examined
		 * @return implementation of IUndoClassRegistration
		 * 
		 */
		function registerClass(clazz:Class, accessorNames:Array=null):IUndoClassRegistration;
		/**
		 * Looks up the appropariate IUndoClassRegistration implementation for the specified object and creates a
		 * IPropertyValueStack implementation for each property/
		 * @param instance the object to be monitored
		 * @return an Array of IPropertyValueStack implementations
		 * @see com.as3undohistory.manage.IPropertyValueStack IPropertyValueStack
		 * 
		 */
		function registerInstance(instance:Object):Array;
		/**
		 * Removes the IUndoClassRegistration from the class registrations
		 * @param clazz
		 * 
		 */
		function unregisterClass(clazz:Class):void;
	}
}